"use client"

import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Button } from "@/components/ui/button"
import { Badge } from "@/components/ui/badge"
import { Separator } from "@/components/ui/separator"
import {
  Calculator,
  FileText,
  BarChart3,
  Users,
  Target,
  DollarSign,
  Lightbulb,
  CheckCircle,
  Download,
  ExternalLink,
} from "lucide-react"

export function EntrepreneurTools() {
  const tools = [
    {
      id: "business-plan",
      name: "商业计划书生成器",
      description: "AI辅助生成专业商业计划书，包含市场分析、财务预测等",
      icon: FileText,
      category: "规划工具",
      difficulty: "简单",
      time: "30分钟",
      features: ["AI智能生成", "专业模板", "数据分析", "投资人视角"],
      price: "免费",
      popular: true,
    },
    {
      id: "financial-model",
      name: "财务模型计算器",
      description: "快速构建财务模型，预测现金流、盈亏平衡点等关键指标",
      icon: Calculator,
      category: "财务工具",
      difficulty: "中等",
      time: "45分钟",
      features: ["现金流预测", "盈亏分析", "敏感性分析", "图表展示"],
      price: "¥99/月",
      popular: false,
    },
    {
      id: "market-analysis",
      name: "市场分析助手",
      description: "行业数据分析，竞争对手研究，市场规模评估",
      icon: BarChart3,
      category: "市场工具",
      difficulty: "中等",
      time: "60分钟",
      features: ["行业报告", "竞品分析", "用户画像", "趋势预测"],
      price: "¥199/月",
      popular: true,
    },
    {
      id: "team-builder",
      name: "团队组建指南",
      description: "帮助创业者找到合适的联合创始人和核心团队成员",
      icon: Users,
      category: "团队工具",
      difficulty: "简单",
      time: "20分钟",
      features: ["角色定义", "技能匹配", "股权分配", "合作协议"],
      price: "免费",
      popular: false,
    },
    {
      id: "mvp-planner",
      name: "MVP规划器",
      description: "帮助定义最小可行产品，制定产品开发路线图",
      icon: Target,
      category: "产品工具",
      difficulty: "中等",
      time: "90分钟",
      features: ["需求分析", "功能优先级", "开发计划", "测试方案"],
      price: "¥149/月",
      popular: true,
    },
    {
      id: "funding-tracker",
      name: "融资进度跟踪",
      description: "管理融资流程，跟踪投资人沟通，记录融资进展",
      icon: DollarSign,
      category: "融资工具",
      difficulty: "简单",
      time: "15分钟",
      features: ["投资人管理", "进度跟踪", "文档管理", "数据分析"],
      price: "¥299/月",
      popular: false,
    },
  ]

  const categories = ["全部", "规划工具", "财务工具", "市场工具", "团队工具", "产品工具", "融资工具"]

  return (
    <div className="space-y-6">
      <div className="flex items-center justify-between">
        <div>
          <h2 className="text-2xl font-semibold text-slate-900">创业工具箱</h2>
          <p className="text-slate-600">专为创业者打造的实用工具集合</p>
        </div>
        <Badge className="bg-blue-100 text-blue-700">{tools.length} 个工具</Badge>
      </div>

      {/* 分类筛选 */}
      <div className="flex flex-wrap gap-2">
        {categories.map((category) => (
          <Button key={category} variant="outline" size="sm" className="rounded-full bg-transparent">
            {category}
          </Button>
        ))}
      </div>

      {/* 工具列表 */}
      <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
        {tools.map((tool) => {
          const Icon = tool.icon
          return (
            <Card
              key={tool.id}
              className="bg-white/70 backdrop-blur-sm border-0 shadow-sm hover:shadow-md transition-all duration-300"
            >
              <CardHeader>
                <div className="flex items-start justify-between">
                  <div className="flex items-center space-x-3">
                    <div className="p-2 bg-blue-100 rounded-lg">
                      <Icon className="w-5 h-5 text-blue-600" />
                    </div>
                    <div>
                      <CardTitle className="text-lg">{tool.name}</CardTitle>
                      <div className="flex items-center space-x-2 mt-1">
                        <Badge variant="outline" className="text-xs">
                          {tool.category}
                        </Badge>
                        {tool.popular && <Badge className="text-xs bg-orange-100 text-orange-700">热门</Badge>}
                      </div>
                    </div>
                  </div>
                </div>
              </CardHeader>
              <CardContent>
                <p className="text-slate-600 text-sm mb-4">{tool.description}</p>

                <div className="space-y-3 mb-4">
                  <div className="flex items-center justify-between text-sm">
                    <span className="text-slate-500">难度等级</span>
                    <Badge
                      variant={
                        tool.difficulty === "简单"
                          ? "default"
                          : tool.difficulty === "中等"
                            ? "secondary"
                            : "destructive"
                      }
                    >
                      {tool.difficulty}
                    </Badge>
                  </div>
                  <div className="flex items-center justify-between text-sm">
                    <span className="text-slate-500">预计用时</span>
                    <span className="font-medium">{tool.time}</span>
                  </div>
                  <div className="flex items-center justify-between text-sm">
                    <span className="text-slate-500">价格</span>
                    <span className="font-medium text-green-600">{tool.price}</span>
                  </div>
                </div>

                <Separator className="my-4" />

                <div className="space-y-2 mb-4">
                  <h4 className="text-sm font-medium text-slate-900">主要功能</h4>
                  <div className="grid grid-cols-2 gap-1">
                    {tool.features.map((feature, index) => (
                      <div key={index} className="flex items-center space-x-1 text-xs text-slate-600">
                        <CheckCircle className="w-3 h-3 text-green-500" />
                        <span>{feature}</span>
                      </div>
                    ))}
                  </div>
                </div>

                <div className="flex space-x-2">
                  <Button className="flex-1" size="sm">
                    <ExternalLink className="w-4 h-4 mr-2" />
                    使用工具
                  </Button>
                  <Button variant="outline" size="sm">
                    <Download className="w-4 h-4" />
                  </Button>
                </div>
              </CardContent>
            </Card>
          )
        })}
      </div>

      {/* 推荐工具组合 */}
      <Card className="bg-gradient-to-r from-blue-50 to-purple-50 border-0 shadow-sm">
        <CardHeader>
          <CardTitle className="flex items-center space-x-2">
            <Lightbulb className="w-5 h-5 text-blue-600" />
            <span>推荐工具组合</span>
          </CardTitle>
        </CardHeader>
        <CardContent>
          <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
            <div className="p-4 bg-white/50 rounded-lg">
              <h4 className="font-medium text-slate-900 mb-2">初创期必备</h4>
              <p className="text-sm text-slate-600 mb-3">适合刚开始创业的团队</p>
              <div className="space-y-1 text-xs text-slate-600">
                <div>• 商业计划书生成器</div>
                <div>• 团队组建指南</div>
                <div>• MVP规划器</div>
              </div>
              <Button size="sm" className="mt-3">
                立即获取
              </Button>
            </div>
            <div className="p-4 bg-white/50 rounded-lg">
              <h4 className="font-medium text-slate-900 mb-2">成长期进阶</h4>
              <p className="text-sm text-slate-600 mb-3">适合已有产品的成长期公司</p>
              <div className="space-y-1 text-xs text-slate-600">
                <div>• 财务模型计算器</div>
                <div>• 市场分析助手</div>
                <div>• 融资进度跟踪</div>
              </div>
              <Button size="sm" className="mt-3 bg-transparent" variant="outline">
                了解详情
              </Button>
            </div>
          </div>
        </CardContent>
      </Card>
    </div>
  )
}
